package com.zlx.entity;

public class Result {
    private boolean success;
    private String message;
    private  Object date;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getDate() {
        return date;
    }

    public void setDate(Object date) {
        this.date = date;
    }

    public Result(boolean success, String message, Object date) {
        this.success = success;
        this.message = message;
        this.date = date;
    }

    @Override
    public String toString() {
        return "Reult{" +
                "success=" + success +
                ", message='" + message + '\'' +
                ", date=" + date +
                '}';
    }
    public Result() {

    }

    public static Result success(Object data){
        return new Result(true, "操作成功", data);
    }

    public static Result error(String message){
        return new Result(false, message, null);
    }

}
